package two_xia.myPainter.shape;

import java.awt.*;

/**
 * 定义ShapeRoundRect类，该类是用来绘制圆角矩形的类
 */
public class ShapeRect extends Shape {


    public ShapeRect(int x1, int y1, int x2, int y2, Color color,
                     BasicStroke s) {
        super(x1, y1, x2, y2, color, s);

    }

    /**
     * 绘制图形的方法
     */
    public void draw(Graphics2D g) {
        g.setStroke(getStroke());// 设置画笔的粗细
        g.setColor(getColor());// 设置画笔的颜色
        g.drawRect(getX1(), getY1(), getX2(), getY2());// 绘制矩形
    }
}